%%%----FILE aleph_data_interface.hrl----
-import(aleph_utility,[time_stamp/1]).
-define(IS_OBJECT(X),is_function(X)).
-record(dht_node,{id="",port="",host="",num=0,fails=0,lastseen=time_stamp(milliseconds)}).
-record(dht_bucket,{max,min,nodes,lastAccessed=now()}).
-record(protocol,{typ=rsp,method,args=[],timer,session_key}).
-record(log_item,{time=now(),level="DEBUG",owner,content=[]}).
-record(session,{key="",target,finished,queried,found,outstanding,answered}).

-define(NODE(N),
        fun(X)->if ?IS_OBJECT(X)==true->{X(num),X};
                true->Y=dht_node:object(X),{Y(num),Y} 
                end
        end (N)).             
-define(BUCKET(X),{X(max),X(min),X}).
-define(MAX_FAILURES,20).
-define(BUCKET_SIZE,8).
         
         